package com.os.sys.controller;

import com.os.sys.common.utility.PubClass;
import com.os.sys.common.utility.XJsonInfo;
import com.os.sys.model.T_SYS_Menu_Power;
import com.os.sys.repository.Menu_PowerRepository;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by Administrator on 2016/12/13.
 */

@RestController
@RequestMapping("/api/sys/menu_power")
public class Menu_PowerController {
    @Resource
    private Menu_PowerRepository menu_powerRepository;
    @Resource
    private PubClass pubClass;

    @RequestMapping(value = "/save", method = RequestMethod.POST)
    public XJsonInfo save(@RequestBody T_SYS_Menu_Power info) {
        menu_powerRepository.save(info);
        return new XJsonInfo();
    }

    @RequestMapping(value = "/remove", method = RequestMethod.DELETE)
    public XJsonInfo remove(Long id) {
        menu_powerRepository.deleteById(id);
        return new XJsonInfo();
    }
}
